Skip to main content

What’s New

Qrvey 8.7
Version 8.7 of the Qrvey platform is now available to customers! This version includes new features including area charts, the ability to pivot and export data, as well as numerous bug fixes and performance improvements.
Learn More
Qrvey 8.6
Version 8.6 of the Qrvey platform is now available to customers. This version includes several new feature enhancements and performance improvements.
Learn More
Required Update for 8.5.1
Attention 8.5.1 customers: for any 8.5.1 instance deployed prior to 08/05/2024, an update is required to ensure you are running the latest images.
Learn More
Qrvey 8.5
Version 8.5 (LTS) of the Qrvey platform is now available to customers. This version includes several new features and performance improvements.
Learn More
End-of-life Schedule
We've added a new article that lists the features and endpoints that have been scheduled for deprecation. All features and endpoints will be supported for (1) year after the release date of the LTS version that contains the alternative.
Learn More
Version: 8.1

Single Panel Widget

The Single Panel widget enables you to embed a chart, metric, or summary panel that has already been created in Qrvey Composer.

Before You Begin

Get the Helper Code

  1. In Qrvey Composer, display the panel that you would like to embed.
  2. Click the three-dot menu in the upper right corner of the panel, and then click the Embed option. A dialog displays with an HTML tag, a JSON configuration object, and the Widget Launcher script tag.
  3. Click Copy to copy the code, and then paste it into your preferred editor.

Embed the HTML tag

Identify where you would like this widget to display in your application, and then add the HTML tag in that location.

The HTML tag for this widget is:

<an-panel config="anPanelConfig"></an-panel>

Embed the Widget Launcher script tag

Add the widget launcher script tag to your application.

For reference, the launcher script code is:

<script type="module" src="<WIDGETS_URL>/qrvey-an-widgets/an-dashboard/andashboard/andashboard.esm.js"></script>
<script nomodule src="<WIDGETS_URL>/qrvey-an-widgets/an-dashboard/andashboard/andashboard.js"></script>

Set properties in the JSON configuration object

Define the JSON configuration object by starting with the script provided in the helper code, and then adding additional configuration properties as needed. The script provided contains only the required properties. For reference, an example is copied below. The helper code that you obtained above should include the unique values indicated with brackets (“<>”):

<script>
var anPanelConfig = {
"api_key": "<API_KEY>",
"app_id": "<APP_ID>",
"domain": "https://your_qrvey_domain",
"user_id": "<USER_ID>",
"qrvey_id": "<QRVEY_ID>",
"type": "<PANEL_TYPE>",
"chart_id": "<CHART_ID>",}
</script>

When complete, add the JSON configuration object to your application.

Configuration Object Properties

The following table lists the properties associated with this widget.

PropertyValueRequired
api_keyString, Your organization’s unique API token required to access the Qrvey platform. Never expose your organization’s API key to external users. In Production environments, use a secure token (qv_token) to encrypt the API key.Yes, if the qv_token is not provided
qv_tokenString, A secure token encrypted via JWT to authenticate and authorize embedded widgets. Establishes a secure connection between the host application and the Qrvey system. For more information, see Embedding Widgets Using a Security Token.Yes, if the api_key is not provided
app_idString, ID of the Qrvey application containing the dashboard, report, automation, or web form.Yes
domainString, The base URL of your instance of the Qrvey platform.Yes
user_idString, ID of the Qrvey Composer user that owns the application that is being embedded. Optional: You can alternately specify the user ID in a Qrvey session cookie.Yes, if the user_id is not included in a session cookie
qrveyidString, ID of the dataset being used.Yes
typeString, Type of panel.
Accepted values:
CHART
METRIC
* SUMMARY
Yes
chart_idString, ID of the chart to display. Required if type is CHART.Yes
metric_idString, ID of the metric to display. Required if type is METRIC.Yes
summary_idString, ID of the summary panel to display. Required if type is SUMMARY.No
summary_typeString, column type. Optional for summary panels.No
panelObject, panel options object.No
panel.headerObject, panel header options object.No
panel.header.visibleBoolean,determines if the panel header is visible. The default setting is true.No
panel.header.draggableBoolean, determines if the panel header has an icon to drag and drop the panel. Used by Custom View and Metric View.No
panel.header.filterBoolean, determines if the panel header has a filter button to open the Filter Modal widget.No
panel.header.menuArray/Boolean, if it's an array, the panel header will show the options passed through the array. If the value is true, the panel header will show a default menu.
Accepted values for the array: EDIT, DOWNLOAD, DUPLICATE, SIZE and DELETE
(Note: SIZE is used only by the Custom View)
No
panel.header.fit_panelBoolean, set if fit to panel button is enabled. False by default.No
panel.header.title_prefixString, prefix for the title of the panel.No
panel.header.externalDownloadArray, set of values to allow external download for defined formats. Used by Page Builder and End User.
Accepted values: CSV
No
panel.bodyObject, panel body options object.No
panel.body.popupObject, panel body popup options object. Used to show Filter By, See Data and Drill-Down options.No
panel.body.popup.itemsArray, set of options to show on the popup. Description of properties are below.
Accepted array items format: {
label: '<popup_item>', // Required
action: <customCallbackFunction()> // Optional
customdrills: <
}
Usage example: [
{ label: 'SEEDATA' },
{ label: 'FILTERBY' },
{ label: 'DRILLDOWN' },
{ label: 'CUSTOMDRILL' }
]
No
panel.body.popup.items[itemIndex]Object, popup item options object to use in panel.body.popup.items array.No
panel.body.popup.items[itemIndex].labelString, option name. Required for this array.No
panel.body.popup.items[itemIndex].actionFunction, custom callback function.No
panel.body.popup.items[itemIndex].drilldownsArray, set of column objects. Used by End-Users.No
panel.body.popup.items[itemIndex].customdrillsArray, set of objects with chart ids, names and other properties. Used by End-Users.No
panel.footerObject, panel footer options object.No
panel.footer.visibleBoolean, determines if a panel footer is visible. The default setting is false.No
page_idString, ID of the page that contains the panel. Required only on Page Builder and End-User.No
tab_idString, ID of the tab that contains the panel. Required only on Page Builder, Report Builder and End User.No
modelObject, dataset model previously defined.No
panel_viewString, name of the view that contains the panel. Required only on Analyze section.
Accepted values: `ANALYZE
ANYWHERE`
filterDataObject, set of previously defined filters to be applied in the panel.
{logic: <Logic Key Structure>}
No
userFiltersObject, the filters object generated by the user. These filters and filterData filters are applied together.
{filters: <Filters Key Structure>}
No
idString, custom ID for the panel element.No
dataObject, internal chart or metric data configuration previously defined. Used by Chart Builder widget to show the preview panel.No
inBuilderBoolean, determines if the panel is the preview on Chart Builder.No
drilldownsObject, drilldowns object previously defined. Used by Custom View and Page Builder.No
customdrillsArray, set of customdrill objects previously defined. Used by End-User.No
clickableBoolean, determines if the panel has click events. Used by End User.No
themeidString, theme ID to use in the componentNo
panel.stylesObject, styles options object. These properties will extend from the current themeNo
panel.styles.chartsTitleString, set the charts title colorNo
panel.styles.chartsFontFamilyString, set the charts font familyNo
panel.styles.axisDataLabelsString, set axis labels color in chartsNo
panel.styles.dataLabelsString, color for data labels in chartsNo
panel.styles.valuesMainString, set color for axis ticks values in chartsNo
panel.styles.chartsLegendsString, color for charts legends labelsNo
panel.styles.chartsTooltipsString, color for charts tooltipsNo
panel.styles.tableHeaderFontString, set color for table header textsNo
panel.styles.chartsMainString, set color for chart data points like bars, symbols and lines.No
panel.styles.themePaletteArray, contains a maximum 20 color for char data points like bars, symbols and lines.No

Samples

The following samples demonstrate how this widget can be used in an HTML page.

Sample Chart

The following sample displays a simple chart. To use this code in your application, replace the values in brackets (“<>”) with your own values.

HTML tag:

<an-panel config="anpanelConfig"></an-panel>

Widget Launcher Script:

<!-- your launcher js link (replace with your js link) -->
<script type="module" src="https://<WIDGETS_URL>/your_qrvey_an_widgets_container/an-dashboard/andashboard/andashboard.esm.js"></script>
<script nomodule src="https://<WIDGETS_URL>/your_qrvey_an_widgets_container/an-dashboard/andashboard/andashboard.js"></script>

JSON Configuration Object:

var anpanelConfig = {
"api_key": "<API_KEY>",
"app_id": "<APP_ID>",
"domain": "https://your_qrvey_domain",
"user_id": "<USER_ID>",
"qrvey_id": "<QRVEY_ID>",
"type": "CHART",
"chart_id": "<CHART_ID>",
"panel": {
"header": {
"menu": ["DOWNLOAD"]
},
"body": {
"popup": {
"items": [
{ "label": "FILTERBY" },
{ "label": "DRILLDOWN" }
]
}
}
}
}
</script>

Sample in CodePen

Chart with Filter

The following sample displays a simple chart with an additional feature: a button that provides users the ability to filter data. To use this code in your application, replace the values in brackets (“<>”) with your own values.

HTML Tag:

<an-panel config="anpanelConfig"></an-panel> 
<button onClick="applyNewFilter()">Apply other filter</button>

Widget Launcher Script:

<!-- your launcher js link (replace with your js link) -->
<script type="module" src="https://<WIDGETS_URL>/your_qrvey_an_widgets_container/an-dashboard/andashboard/andashboard.esm.js"></script>
<script nomodule src="https://<WIDGETS_URL>/your_qrvey_an_widgets_container/an-dashboard/andashboard/andashboard.js"></script>

JSON Configuration Object:

<script>
var anpanelConfig = {
"api_key": "<API_KEY>",
"app_id": "<APP_ID>",
"domain": "https://your_qrvey_domain",
"user_id": "<USER_ID>",
"qrvey_id": "<QRVEY_ID>",
"type": "CHART",
"chart_id": "<CHART_ID>",
"panel": {
"header": {
"menu": ["DOWNLOAD"]
},
"body": {
"popup": {
"items": [
{ "label": "FILTERBY" },
{ "label": "DRILLDOWN" }
]
}
}
},
"userFilters": {
"filters": [{
"operator": "AND",
"expressions": [
{
"enabled": true,
"questionid": "<QUESTION_ID>",
"validationType": "<VALIDATION_TYPE>",
"value": [
"<VALUE_TO_FILTER_1>"
]
}
]
}]
}
}
</script>
<script>
function applyNewFilter() {
window.dispatchEvent(new CustomEvent('anApplyUserFilters', {
detail: {
"filters": [{
"operator": "AND",
"expressions": [
{
"enabled": true,
"questionid": "<QUESTION_ID>",
"validationType": "<VALIDATION_TYPE>",
"value": [
"<VALUE_TO_FILTER_2>"
]
}
]
}]
}
}));
}
</script>

Sample in CodePen: